//
// Exercise 11.1tx - http://tronixstuff.com/tutorials > Chapter 11
// send signals to rx module to switch on and off three digital pins
// 
// based on code by Mike McCauley 2010 http://www.open.com.au/mikem/arduino
//
//


// Need these lines below ///////////////////
#include <VirtualWire.h> 
#undef int
#undef abs
#undef double
#undef float
#undef round
////////////////////////////////////////////

const char *redoff = "a";       // to turn off the red LED, send "aa" down the wireless tube, etc.
const char *redon = "b";       
const char *yellowoff = "c";   
const char *yellowon = "d";      
const char *greenoff = "e";      
const char *greenon = "f";      


void setup()
{
  // Initialise the IO and ISR
  vw_set_ptt_inverted(true);      // Required for RF Link module
  vw_setup(2400);                 // Bits per sec
  vw_set_tx_pin(1);               // pin 1 is the TX pin on our Arduino Duemilanove
}

void loop()
{
  delay(1000);
  vw_send((uint8_t *)redon, strlen(redon)); 
  vw_wait_tx();                           // Wait for sending of message to finish. 
  delay(1000);
  vw_send((uint8_t *)redoff, strlen(redoff)); 
  vw_wait_tx();                           
  delay(1000);
  vw_send((uint8_t *)yellowon, strlen(yellowon)); 
  vw_wait_tx();                            
  delay(1000);
  vw_send((uint8_t *)yellowoff, strlen(yellowoff)); 
  vw_wait_tx();                           
  delay(1000);
  vw_send((uint8_t *)greenon, strlen(greenon)); 
  vw_wait_tx();                            
  delay(1000);
  vw_send((uint8_t *)greenoff, strlen(greenoff)); 
  vw_wait_tx();                           
}

